package fr.afcepf.atod18.client.service;




import fr.afcepf.atod18.client.entity.Client;
import fr.afcepf.atod18.client.idao.IDaoClient;

public class ServiceClient {
	private IDaoClient daoClient ;
	
	public IDaoClient getDaoClient() {
		return daoClient;
	}

	public void setDaoClient(IDaoClient daoClient) {
		this.daoClient = daoClient;
	}

	public void ajoutClient (Client cl){
	 
//		ApplicationContext ctx = new ClassPathXmlApplicationContext("springConf.xml");
//		DaoClient dclient = (DaoClient)ctx.getBean("daoClient");
//		dclient.ajouterClient(cl);
		daoClient.ajouterClient(cl);
		}
	
	public  void modifierClient(Client cl){
//		ApplicationContext ctx = new ClassPathXmlApplicationContext("springConf.xml");
//		DaoClient dclient = (DaoClient)ctx.getBean("daoClient");
//		dclient.modifierClient(cl);
		daoClient.modifierClient(cl);
	}
	
	public  Client chercherClient(String loggin2){
		
//		ApplicationContext ctx = new ClassPathXmlApplicationContext("springConf.xml");
//		DaoClient dclient = (DaoClient)ctx.getBean("daoClient");
//		dclient.rechercherClient(loggin2);
		
	    return daoClient.rechercherClient(loggin2);
		
		
	}

}
